package com.dingreading.cloud.admin.service;

import com.dingreading.cloud.admin.entity.AdminMenus;
import com.mybatisflex.core.service.IService;

import java.util.List;

/**
 * 服务层。
 *
 * @author Administrator
 * @since 2023-11-22
 */
public interface AdminMenusService extends IService<AdminMenus> {

    List<AdminMenus> getAllList();

    boolean updateNodes(Long id, String nodes);

    List<AdminMenus> getByNodesNotId(String nodes, Long id);

    int dropBean(Long id);

    List<AdminMenus> getByRoleIdAndEnabled(Long roleId, Integer enabled);

    List<AdminMenus> listByRoleIdAndEnabled(List<Long> roleIds, Integer enabled);

    // 获取最大的序号
    int getMaxShowOrder(Long parentId);

    AdminMenus getGtOrderNum(Long parentId, Integer orderNum);

    AdminMenus getLtOrderNum(Long parentId, Integer orderNum);

    /**
     * 设置序号
     */
    void updateOrderNum(Long id, Integer orderNum);

    boolean updateEnabled(Long id, Integer enabled);

    /**
     * 启用/禁用下级子菜单
     */
    boolean updateChildEnabled(String nodes, Integer enabled);
}
